from django.urls import path
from django.urls import re_path
from rbac.views.account import Login
from rbac.views.home import HomeView
from rbac.views import role
from rbac.views import menu
from rbac.views import permission
urlpatterns=[
    path('login/',Login.as_view(),name='login'),
    path('home/',HomeView.as_view(),name='home'),

    path('role/list/',role.RoleListView.as_view(),name='role_list'),
    path('role/add/',role.RoleAddView.as_view(),name='role_add'),
    re_path('role/edit/(?P<pk>\d+)/',role.RoleEditView.as_view(),name='role_edit'),
    re_path('role/delete/(?P<pk>\d+)/',role.RoleDeleteView.as_view(),name='role_delete'),

    path('menu/list/',menu.MenuListView.as_view(),name='menu_list'),
    path('menu/add/',menu.MenuAddView.as_view(),name='menu_add'),
    re_path('menu/edit/(?P<pk>\d+)/',menu.MenuEditView.as_view(),name='menu_edit'),
    re_path('menu/delete/(?P<pk>\d+)/',menu.MenuDeleteView.as_view(),name='menu_delete'),

    path('permission/list/',permission.PermissionListView.as_view(),name='permission_list'),
    path('permission/distribute/',permission.PermissionDisTribute.as_view(),name='permission_distribute'),
    path('permission/add/',permission.PermissionAddView.as_view(),name='permission_add'),
    re_path('permission/edit/(?P<pk>\d+)/',permission.PermissionEditView.as_view(),name='permission_edit'),
    re_path('permission/delete/(?P<pk>\d+)/',permission.PermissionDeleteView.as_view(),name='permission_delete'),

    path('multi/permissions/',permission.MultiPermissionsView.as_view(),name='multi_permissions') #权限批量操作
]